home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1996 / MacHack 1996.toast / Hacks / Hacks ’92 / Run & Stumpy / source / errorsource.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-18  |  482 b   |  29 lines  |  [TEXT/MPS ]

  1. // errorsource.h
  2.  
  3. #ifndef errorsource_h
  4. #define errorsource_h
  5.  
  6. #include <types.h>
  7.  
  8. #ifndef inttypes_h
  9. #include "inttypes.h"
  10. #endif
  11.  
  12. class errorsource
  13.   {
  14.     protected:
  15.         OSErr error;
  16.     
  17.     public:
  18.         errorsource()                        { error= noErr; }
  19.         
  20.         void clearerror()                    { error= noErr; }
  21.         
  22.         boolean iswrong() const            { return error != noErr; }
  23.         OSErr whatiswrong() const        { return error; }
  24.         
  25.         void ignore(OSErr toignore)    { if (error == toignore) clearerror(); }
  26.   };
  27.  
  28. #endif errorsource_h
  29.